package
{
	import com.xcopy.Screen;
	import flash.display.MovieClip;
	import flash.filters.BlurFilter;

	public class Slot25SlotItem extends Screen
	{
		protected const BLUR_RATE:Number = 1;
		protected var _icon:Number       = 0;
		protected var _blur:BlurFilter   = new BlurFilter(0, 0);

		public function Slot25SlotItem(r:* = null)
		{
			super(r);
		}

		override public function set clip(mc:MovieClip):void
		{
			super.clip = mc;
			mc.filters = [_blur];
		}

		public function get height():Number
		{
			return clip.height;
		}

		public function set y(n:Number):void
		{
			clip.y = n;
		}

		public function get y():Number
		{
			return clip.y;
		}

		public function play():void
		{
			clip.gotoAndPlay('Play' + _icon);
		}

		public function normal():void
		{
			clip.gotoAndStop('Normal' + _icon);
		}

		// 設定圖像的編號 0-10
		public function set icon(n:Number):void
		{
			if (n < 0 || n > 10)
			{
				return;
			}
			_icon = n;
			clip.gotoAndStop('Normal' + n);
		}

		public function get icon():Number
		{
			return _icon;
		}

		public function setBlur(vertical:Number):void
		{
			_blur.blurY = vertical / BLUR_RATE;
			clip.filters = [_blur];
		}
	}
}
